#include "calculateCenter2.h"

Result test2() {
	IplImage* img = cvLoadImage("C:\\Documents and Settings\\snirbo\\Desktop\\calculate_center\\pic1.bmp");	
	int* new_data = ConvertFromRgbToHsv(img);
	car test_car;
	test_car.licensePlate = 1;
	test_car.red = 0;
	test_car.green = 0;
	test_car.blue = 0;
	test_car.h = 0;
	test_car.s = 0;
	test_car.v = 0;
	test_car.p = cvPoint(0, 0);

	CvPoint x = calculateCenter(img, new_data, test_car);
	if ( (x.x == -1) && (x.y == -1) ) {
		return (printTestResult(2, FAIL));
	} else {
		return (printTestResult(2, SUCCESS));
	}
}

#ifdef __TEST2__
int main(int argc, char **argv) {
	if (!test1() || !test2()) {
		cout << "TOTAL TEST FAILED!\n";
		getchar();
		exit(1);
	}
	cout << "TOTAL TEST SUCCEEDED\n";
	getchar();
	return 0;
}
#endif